package Basic;

public class bit {
    public static void main(String[] args){
		System.out.println("and运算");
		System.out.printf("0 and 0 %5d%n",0&0 );
		System.out.printf("0 and 1 %5d%n",0&1 );
		System.out.printf("1 and 0 %5d%n",1&0  );
		System.out.printf("1 and 1 %5d%n",1&1  );
		
		System.out.println("\nor运算" );
		System.out.printf("0 or 0 %6d%n",0|0 );
		System.out.printf("0 or 1 %6d%n",0|1 );
		System.out.printf("1 or 0 %6d%n",1|0 );
		System.out.printf("1 or 1 %6d%n",1|1);
		
		System.out.printf("\nxor运算" );
		System.out.printf("0 xor 0 %5d%n",0^0 );
		System.out.printf("1 xor 0 %5d%n",1^0 );
		System.out.printf("0 xor 1 %5d%n",0^1 );
		System.out.printf("1 xor 1 %5d%n",1^1 );
	}
}
